/*    */ package com.zimbra.cs.mailbox;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.db.DbMailItem;
/*    */ import com.zimbra.cs.mime.ParsedDocument;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class WikiItem
/*    */   extends Document
/*    */ {
/*    */   public static final String WIKI_CONTENT_TYPE = "text/html; charset=utf-8";
/*    */   
/*    */   WikiItem(Mailbox mbox, MailItem.UnderlyingData data)
/*    */     throws ServiceException
/*    */   {
/* 28 */     this(mbox, data, false);
/*    */   }
/*    */   
/*    */   WikiItem(Mailbox mbox, MailItem.UnderlyingData data, boolean skipCache) throws ServiceException {
/* 32 */     super(mbox, data, skipCache);
/*    */   }
/*    */   
/*    */   public String getWikiWord() {
/* 36 */     return getName();
/*    */   }
/*    */   
/*    */ 
/*    */   static WikiItem create(int id, String uuid, Folder folder, String wikiword, ParsedDocument pd, MailItem.CustomMetadata custom)
/*    */     throws ServiceException
/*    */   {
/* 43 */     Metadata meta = new Metadata();
/* 44 */     MailItem.UnderlyingData data = prepareCreate(MailItem.Type.WIKI, id, uuid, folder, wikiword, "text/html; charset=utf-8", pd, meta, custom, 0);
/*    */     
/* 46 */     Mailbox mbox = folder.getMailbox();
/* 47 */     data.contentChanged(mbox);
/* 48 */     ZimbraLog.mailop.info("Adding WikiItem %s: id=%d, folderId=%d, folderName=%s.", new Object[] { wikiword, Integer.valueOf(data.id), Integer.valueOf(folder.getId()), folder.getName() });
/*    */     
/* 50 */     new DbMailItem(mbox).create(data);
/*    */     
/* 52 */     WikiItem wiki = new WikiItem(mbox, data);
/* 53 */     wiki.finishCreation(null);
/* 54 */     pd.setVersion(wiki.getVersion());
/* 55 */     return wiki;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailbox/WikiItem.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */